package svc

import (
	"C/api_C/internal/config"
	"C/api_C/internal/middleware"
	"C/renrenzhuC_srv/renrenzhucclient"
	"github.com/zeromicro/go-zero/rest"
	"github.com/zeromicro/go-zero/zrpc"
)

type ServiceContext struct {
	Config         config.Config
	JwtToken       rest.Middleware
	RenrenzhuC_Srv renrenzhucclient.RenrenzhuC
}

func NewServiceContext(c config.Config) *ServiceContext {
	return &ServiceContext{
		Config:         c,
		JwtToken:       middleware.NewJwtTokenMiddleware().Handle,
		RenrenzhuC_Srv: renrenzhucclient.NewRenrenzhuC(zrpc.MustNewClient(c.RenrenzhuC_Srv)),
	}
}
